<?php
/**
 * Created by PhpStorm.
 * User: xuzhong
 * Date: 2025/4/2
 * Time: 13:49
 */

namespace app\api\service;

use app\api\model\Message as MessageModel;
use app\api\model\Images;
use app\facade\Basic;
class Message
{

    protected $model;

    public function __construct()
    {
        $this->model = new MessageModel();

    }

    /**
     * @describe 站内信创建
     * @author: 徐众
     * @date: 2025-04-02 13:02:26
     * @param [] type
     * @return Renderable
     */
    public function save($params): array
    {
        #参数校验
        if (!isset($params['content']) || empty($params['content'])) {
            return Basic::data( 100002, 'common.parameterError');
        }
        $params['create_time'] =date("Y-m-d H:i:s",time());

        $create= $this->model->create($params);
        return Basic::data(0, 'common.success',[]);
    }

}